package com.aboverock.module.system.validator.constraints;

import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import javax.validation.Constraint;
import javax.validation.Payload;

import com.aboverock.module.system.validator.constraintvalidators.UniqueFieldsValidator;


/**
 * 类（数据库表对应）中指定的多字段是否唯一.
 *
 * @author Rock Wang
 */
@Documented
@Constraint(validatedBy = { UniqueFieldsValidator.class })
@Target({ ElementType.TYPE })
@Retention(RUNTIME)
public @interface UniqueFields {
    
    Class<?> clazz();

    String[] fields() default {};

    String message() default "{smart.validator.constraints.UniqueFields.message}";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
